package com.xzan.medusaweb.basicdesign.test.singleton;

public class Singleton {
    private volatile static Singleton singleton=null;
    private Singleton(){

    }
    public static Singleton getInstance(){
        if (singleton==null){
            synchronized (Singleton.class){
                singleton=new Singleton();
            }
        }
        return singleton;
    }
    public static void main(String[] args){
        Singleton.getInstance();
    }
}
